package org.lansir.af.dataview;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import org.lansir.af.database.DataRowTrusty;
import org.lansir.af.database.Database;

import android.database.Cursor;

public class DataViewTrusty extends DataView {
//To show the Groups message


	

	public DataViewTrusty(Database db) {
		super(db);
		sTableName = Database.sTableNameTrustys;
	}
	
	public String getTableName()
	{
		return sTableName;
	}

	protected void addItem(Cursor cr)
	{
		DataViewTrustyItem item = new DataViewTrustyItem();
		item.setID(cr.getInt(DataRowTrusty.fid.ID));
		item.setType(cr.getInt(DataRowTrusty.fid.TYPE));
		item.setName(cr.getString(DataRowTrusty.fid.Name));
		item.setMemberId(cr.getString(DataRowTrusty.fid.MemberID));

		rows.add(item);
	}




	@Override
	protected void sortView() {
		
	}
	
	public boolean getTrusted(String iMemberId){
		for(DataViewItem dataViewItem : rows){
			DataViewTrustyItem dataViewTrustyitem = (DataViewTrustyItem)dataViewItem;
			if(dataViewTrustyitem.getMemberId().equals(iMemberId))
				return true;
		}
		return false;
	}


	@Override
	protected void filterDataForView(DataViewItem item, Calendar calStartDate,
			int dayType) {
		// TODO Auto-generated method stub
		
	}


	@Override
	protected void filterDataPrepare(Calendar calStartDate, int dayType) {
		// TODO Auto-generated method stub
		
	}	
}
